More tweaks. Check only if at least one of those Unicode subrange bits we
authorTor Lillqvist <tml@iki.fi>
Sun, 12 Dec 1999 01:32:53 +0000 (01:32 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 12 Dec 1999 01:32:53 +0000 (01:32 +0000)
1999-12-11  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
tweaks. Check only if at least one of those Unicode subrange bits
we care for is set. If no code page bits are set, guess (wildly)
based on the charset.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkfont-win32.c

index 40737f352baf330da234968f3d8949cef67989ba..99af5ca197633f457aea924d5b322048fa0a6f9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * gdk/win32/makefile.msc: Update.
 
+       * gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
+       tweaks. Check only if at least one of those Unicode subrange bits
+       we care for is set. If no code page bits are set, guess (wildly)
+       based on the charset.
+
        * gdk/win32/gdkinput-win32.c: Remove debugging leftover.
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_new): Assure title is
index 40737f352baf330da234968f3d8949cef67989ba..99af5ca197633f457aea924d5b322048fa0a6f9a 100644 (file)
 
        * gdk/win32/makefile.msc: Update.
 
+       * gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
+       tweaks. Check only if at least one of those Unicode subrange bits
+       we care for is set. If no code page bits are set, guess (wildly)
+       based on the charset.
+
        * gdk/win32/gdkinput-win32.c: Remove debugging leftover.
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_new): Assure title is
index 40737f352baf330da234968f3d8949cef67989ba..99af5ca197633f457aea924d5b322048fa0a6f9a 100644 (file)
 
        * gdk/win32/makefile.msc: Update.
 
+       * gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
+       tweaks. Check only if at least one of those Unicode subrange bits
+       we care for is set. If no code page bits are set, guess (wildly)
+       based on the charset.
+
        * gdk/win32/gdkinput-win32.c: Remove debugging leftover.
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_new): Assure title is
index 40737f352baf330da234968f3d8949cef67989ba..99af5ca197633f457aea924d5b322048fa0a6f9a 100644 (file)
 
        * gdk/win32/makefile.msc: Update.
 
+       * gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
+       tweaks. Check only if at least one of those Unicode subrange bits
+       we care for is set. If no code page bits are set, guess (wildly)
+       based on the charset.
+
        * gdk/win32/gdkinput-win32.c: Remove debugging leftover.
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_new): Assure title is
index 40737f352baf330da234968f3d8949cef67989ba..99af5ca197633f457aea924d5b322048fa0a6f9a 100644 (file)
 
        * gdk/win32/makefile.msc: Update.
 
+       * gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
+       tweaks. Check only if at least one of those Unicode subrange bits
+       we care for is set. If no code page bits are set, guess (wildly)
+       based on the charset.
+
        * gdk/win32/gdkinput-win32.c: Remove debugging leftover.
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_new): Assure title is
index 40737f352baf330da234968f3d8949cef67989ba..99af5ca197633f457aea924d5b322048fa0a6f9a 100644 (file)
 
        * gdk/win32/makefile.msc: Update.
 
+       * gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
+       tweaks. Check only if at least one of those Unicode subrange bits
+       we care for is set. If no code page bits are set, guess (wildly)
+       based on the charset.
+
        * gdk/win32/gdkinput-win32.c: Remove debugging leftover.
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_new): Assure title is
index 40737f352baf330da234968f3d8949cef67989ba..99af5ca197633f457aea924d5b322048fa0a6f9a 100644 (file)
 
        * gdk/win32/makefile.msc: Update.
 
+       * gdk/win32/gdkfont-win32.c (check_unicode_subranges): More
+       tweaks. Check only if at least one of those Unicode subrange bits
+       we care for is set. If no code page bits are set, guess (wildly)
+       based on the charset.
+
        * gdk/win32/gdkinput-win32.c: Remove debugging leftover.
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_new): Assure title is
index e64c3f95d283e526adb1a599dad03e7fc3598c0b..dce4e0774c3b068bbdcf49c21e00534d8b813801 100644 (file)
@@ -517,7 +517,8 @@ typedef enum
   U_SMALL_FORM_VARIANTS = 66,
   U_ARABIC_PRESENTATION_FORMS_B = 67,
   U_SPECIALS = 69,
-  U_HALFWIDTH_AND_FULLWIDTH_FORMS = 68
+  U_HALFWIDTH_AND_FULLWIDTH_FORMS = 68,
+  U_LAST_PLUS_ONE
 } unicode_subset;
 
 static struct {
@@ -696,18 +697,19 @@ static gboolean
 check_unicode_subranges (UINT           charset,
                         FONTSIGNATURE *fsp)
 {
+  gint i;
   gboolean retval = FALSE;
 
-  /* If the fsUsb bit array has some bits set, trust it */
-  if (fsp->fsUsb[0] || fsp->fsUsb[1] || fsp->fsUsb[2] || fsp->fsUsb[3])
-    return FALSE;
+  /* If the fsUsb bit array has at least one of the bits set, trust it */
+  for (i = 0; i < U_LAST_PLUS_ONE; i++)
+    if (i != U_PRIVATE_USE_AREA && (fsp->fsUsb[i/32] & (1 << (i % 32))))
+      return FALSE;
 
   /* Otherwise, guess what subranges there should be in the font */
   fsp->fsUsb[0] = fsp->fsUsb[1] = fsp->fsUsb[2] = fsp->fsUsb[3] = 0;
 
 #define set_bit(bitno) (fsp->fsUsb[(bitno)/32] |= (1 << ((bitno) % 32)))
 
-#if 1
   /* Set Unicode subrange bits based on code pages supported.
    * This is mostly just guesswork.
    */
@@ -868,10 +870,16 @@ check_unicode_subranges (UINT           charset,
       set_bit (U_LATIN_1_SUPPLEMENT);
       retval = TRUE;
     }
-#else
-  /* Guess based on charset. These somewhat optimistic guesses are
-   * based on the table in Appendix M in the book "Developing ..."
-   * mentioned above.
+
+  if (retval)
+    return TRUE;
+
+  GDK_NOTE (MISC, g_print ("... No code page bits set!\n"));
+
+  /* Sigh. Not even any code page bits were set. Guess based on
+   * charset, then. These somewhat optimistic guesses are based on the
+   * table in Appendix M in the book "Developing ..."  mentioned
+   * above.
    */
   switch (charset)
     {
@@ -1101,7 +1109,6 @@ check_unicode_subranges (UINT           charset,
       retval = TRUE;
       break;
     }
-#endif
 
 #undef set_bit
   return retval;